package org.java.async;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.concurrent.*;

/**
 * @Description ExecutorService Demo
 * @Date 2024/11/5 8:43
 * @Created by 10574
 */
public class ExecutorServiceDemo {
    private static final ExecutorService executorService = Executors.newFixedThreadPool(10);
    private static final Logger log = LoggerFactory.getLogger(ExecutorServiceDemo.class);
    public static void main(String[] args) {
        final Future<Integer> future = executorService.submit(() ->{
            Thread.sleep(10000);
            return 1;
        });
        log.info("class:{}", future.getClass());
       if (future instanceof FutureTask) {
           log.info("-----------");
       }
    }

}
